<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>模版数据管理 HDSysCms</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="<?php echo getcdnurlhost() ?>/admin/style/admin.css" media="all">
</head>
<body data="HDSYSCMS 2021本系统受国家版权局保护请勿破解或者二次开发传播">
<div class="layui-fluid1">
<div class="layui-row layui-col-space151">
<div class="layui-col-md12">
<div class="layui-card">
<div style="position: fixed;z-index: 999;background-color: #fff;width: 100%;box-shadow: 0px 1px 5px #2e8cee33;" class="layui-tab layui-tab-brief" lay-filter="component-tabs-hash">
<ul class="layui-tab-title">
<li class="layui-this" id="hdsysatable" lay-id="hdsysatable">模块列表</li>
<li lay-id="hdsysadd" id="hdsysadd">新增模块</li>
<li lay-id="shopadd" id="shopadd">在线资源商城库添加模块</li>
</ul>
<div style="overflow-y: scroll;height: calc(100vh - 73px);" class="layui-tab-content layui-card-body1">
<div class="layui-tab-item layui-show">
<form class="layui-form layui-form-pane" action="">
<div style="width: 100%;" class="layui-inline">
<div style="width: 100%;" class="layui-input-inline">
<input style="width: 100%;" class="layui-input" name="keyword" placeholder="请输入检索内容" id="demoReload">
</div>
</div>
</form>
<table style="padding-top: 100px;" lay-skin="line" lay-size="lg" class="layui-table" lay-even="test-table-toolbar" id="test-table-toolbar" lay-filter="test-table-toolbar"></table>
<script type="text/html" id="test-table-toolbar-barDemo"><div><div class="MHover"><a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del"><i class="layui-icon">&#xe640;</i>删除</a>{{# if(d.id !='' ){ }}<a class="layui-btn layui-btn-xs layui-btn" lay-event="HDSYSCMS_OPEN"><i class="layui-icon">&#xe609;</i>上传到商店</a>{{# } }}</div></div></script>
</div>
<div style="height: 100%;" class="layui-tab-item ">
<div style="height: 100%;display: flex;align-content: center;">
<form style="width: 500px;margin: 0 auto;display: flex;flex-direction: column;justify-content: center;" class="layui-form" action="#">
<div class="layui-form-item">
<label class="layui-form-label">模块文件</label>
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="filename" value="" placeholder="文件名称 如 head.php links.php" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">模块名称</label>
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="name" value="" size="10" placeholder="名称5-10个字内" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">功能描述</label>
<div class="layui-input-inline" style="width: 300px;">
<input type="text" name="info" value="" placeholder="头部模块" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"></label>
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="setup">新增并使用模块</button>
</div>
</div>
</form>
</div>
</div>
<div style="height: 100%;" class="layui-tab-item ">
<div style="height: 100%;display: flex;align-content: center;">
<iframe src="//www.hdsyscms.com/vip-template/mode-list.php?domain=<?php echo $_SERVER['HTTP_HOST']; ?>" frameborder="0" class="hdsys-mode-iframe"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php adminechohtnl(); ?>
<script src="<?php echo getcdnurlhost() ?>/admin/layui/layui.js"></script>
<script src="<?php echo getcdnurlhost() ?>/jquery.min.js"></script>
<script>let bin_is=0;layui.config({base: '<?php echo getcdnurlhost() ?>/admin/'}).extend({index: 'lib/index'}).use(['jquery', 'index', 'element', 'table', 'form', 'layer'], function() {var admin=layui.admin,$=layui.$,form=layui.form,element=layui.element,table=layui.table;element.render();var layid=location.hash.replace(/^#layid=/, '');layid && element.tabChange('component-tabs-hash', layid);element.on('tab(component-tabs-hash)', function(elem) {location.hash='#layid=' + $(this).attr('lay-id');});$(document).on('keydown', '.layui-input',function(event) {});table.on('radio(test-table-toolbar)', function(obj) {hdsyssetmode(obj.data.name);});form.on('submit(setup)', function(data) {data=data.field;var filename=data.filename;var info=data.info;var name=data.name;$.ajax({type: "post",url: 'index.php?m=manage&c=Div&a=add_Public_ajax&id=<?php echo set_get('id'); ?>&dir=<?php echo set_get('dir'); ?>&file=<?php echo set_get('file'); ?>',data: "filename=" + filename + "&info=" + info + "&name=" + name,dataType: "json",success: function(ret) {layer.msg(ret.msg);if (ret.code==1) {var index=parent.layer.getFrameIndex(window.name);parent.layer.close(index);hdsyssetmode(filename);}}});return false;});table.render({elem: '#test-table-toolbar',url: 'index.php?m=<?php echo set_get('m'); ?>&c=<?php echo set_get('c'); ?>&a=<?php echo set_get('a'); ?>_ajax&json=get&soso_ok=1&id=<?php echo set_get('id'); ?>&dir=<?php echo set_get('dir'); ?>&file=<?php echo set_get('file'); ?>',toolbar: false,skin: 'line',title: '模块列表',height: "full",groups: 1,first: false,last: false,cols: [[{type: 'radio'},{field: 'ShowName',width: 200,title: '',templet: '<div title="{{d.name}}" ><span  title="{{d.name}}" class="texts-sm">{{d.ShowName}}</span></div>',}, {field: 'ShowInfo',maxwidth: 200,title: ''},, {title: '',toolbar: '#test-table-toolbar-barDemo',width: 250}]],page: false,done: function(res, curr, count) {var datas=table.getData('test-table-toolbar');var arr=datas;for (var i=0; i < arr.length; i++) {if (arr[i].name=='<?php echo $pram_mode_name; ?>') {let tr=$(".layui-table-body tr[data-index='" + i + "']");tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');tr.find(".layui-form-radio").click();}}table.render();bin_is=1;}});table.on('edit(test-table-toolbar)', function(obj) {var value=obj.value,data=obj.data,field=obj.field;$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c') ?>&a=edit_table_ajax',data: 'id=' + data.id + "&field=" + value,dataType: "json",success: function(ret) {layer.msg(ret.msg);table.reload('test-table-toolbar', {page: {curr: 1}});},error: function(e, t) {layer.alert('接口请求返还异常');}});});table.on('tool(test-table-toolbar)', function(obj) {var data=obj.data;if (obj.event==='HDSYSCMS_OPEN') {if (data.id=='') {layer.alert('hdsysinfo标签没有id标签,请手动填写id编码才可上传.');return false;}$("#shopadd").click();$(".hdsys-mode-iframe").attr('src', "index.php?m=manage&c=Div&a=openup&dir=<?php echo set_get('dir') ?>&file=" + data.name);} else if (obj.event==='del') {layer.confirm('你确认删除[' + data.ShowName + ']？ 文件名:' + data.name, {btn: ['确定删除', '取消']}, function() {$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get('c') ?>&a=del_ajax',data: 'name=' + data.name + '&dir=<?php echo set_get('dir') ?>',dataType: "json",success: function(ret) {layer.msg(ret.msg);obj.del();},error: function(e, t) {layer.alert('接口请求返还异常');}});}, function() {});} else if (obj.event==='edit') {var layid=top.layer.open({type: 2,title: '',area: ['85%', '85%'],fixed: false,maxmin: false,content: 'index.php?m=manage&c=Div&a=html&dir=<?php echo set_get('dir') ?>&id=<?php echo set_get('id') ?>&file=<?php echo set_get('file') ?>'});}});$('.layuiadmin-btn-useradmin').on('click', function() {table.reload('test-table-toolbar', {page: {curr: 1},where: {soso: $("#soso").val()}});});$('.bin-add').on('click', function() {location.href="index.php?m=manage&c=<?php echo set_get('c') ?>&a=add";});window.hdsyssetmode=function(mode_name) {if (bin_is==0) {return false;};$.ajax({type: "post",url: 'index.php?m=manage&c=<?php echo set_get("c") ?>&a=set_mode',data: 'mode_name=' + mode_name + '&id=<?php echo $param_id ?>&dir=<?php echo $param_dir ?>&file=<?php echo $param_file ?>',dataType: "json",success: function(ret) {layer.msg(ret.msg);window.location.reload();top.document.getElementById('iframe').contentWindow.location.reload();var index=parent.layer.getFrameIndex(window.name);parent.layer.close(index);},error: function(e, t) {layer.alert('接口请求返还异常');}});};$(".HDSYSCMS-SET").click(function() {var mode_name=$(this).attr("val");hdsyssetmode(mode_name);return false;});$(document).on('click', ".hdsys-add-Public", function(e) {var layid=layer.open({type: 2,title: '新增空白模块',area: ['700px', '350px'],fixed: false,maxmin: false,content: 'index.php?m=manage&c=Div&a=add_Public&id=<?php echo $param_id ?>&dir=<?php echo $param_dir ?>&file=<?php echo $param_file ?>',success: function(layero, index) {var body=layer.getChildFrame('body', index);var iframeWin=window[layero.find('iframe')[0]['name']];}});return;});window.hdsysretable=function() {var demoReload=$('#demoReload');bin_is=0;table.reload('test-table-toolbar', {page: false,where: {name: demoReload.val()},done: function(res, curr, count) {var datas=table.getData('test-table-toolbar');var arr=datas;for (var i=0; i < arr.length; i++) {if (arr[i].name=='<?php echo $pram_mode_name; ?>') {let tr=$(".layui-table-body tr[data-index='" + i + "']");tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');tr.find(".layui-form-radio").click();}};table.render();bin_is=1;}});};$('#demoReload').on('input', function() {hdsysretable();});});</script>
<style>.templetimg {width: 90px;height: 60px;}.layui-card-body1 {padding: 10px 15px;line-height: 24px;padding-top: 50px;}.layui-table {width: 100% !important;}.MHover {opacity: 0;}.layui-table-hover .MHover {opacity: 1;}.layui-table-click,.layui-form-radioed1 {background-color: #1b84ed2e;border: 2px solid #1b84ed69;}.layui-table,.layui-table-view {margin: 5px 0;}.layui-table-header table {display: none;}.hdsys-mode-iframe {position: absolute;width: 100%;height: 100%;left: 0;top: 45px;right: 0;bottom: 0;}</style>
</body>
</html>